

public class BuildingManagement {
Asset things[] = new Asset[24];
int numItems = 0;


public void goodNight() {
  for (int i = 1; i < things.lenght; i++)
     if (things[i] instanceof PowerSwitchable)
        ((PowerSwitchable)things[i]).powerDown();
}


public void add(Asset thing){
  System.out.println("Adauga" + thing);
  things[numItems++] = thing;
}


public static void main(String[] av) {
  BuildingManagement b1 = new BuildingManagement();
  b1.add(new RoomLights(101)); 
  b1.add(new EmergencyLight(101)); 
  
  b1.add(new ComputerCPU(10104));
  
  b1.add(new ComputerMonitor(10104));

 
  b1.goodNight();
   }
 }
